package P9.T05;

import javax.swing.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

public class T05 {
    public static void main(String[] args) throws IOException {
        JFileChooser fc=new JFileChooser();
        if(fc.showSaveDialog(null)==JFileChooser.APPROVE_OPTION){
            //System.out.println(fc.getSelectedFile().getAbsolutePath());
            SaveFile(fc.getSelectedFile());
        }
    }

    private static void SaveFile(File f) throws IOException {
        FileOutputStream fos=new FileOutputStream(f);
        fos.write("河北大学".getBytes());
        fos.close();
    }
}
